const express = require("express");
const axios = require("axios");
// const {createProxyMiddleware} = require("http-proxy-middleware");
const app = express();
app.use(express.static(__dirname));
// app.use("/api",createProxyMiddleware({
// 	target:"http://127.0.0.1",
// 	changeOrigin:true,
// 	pathRewrite:{
// 		"^/api":""
// 	}
// }))

app.use("/api",(req,res)=>{
	console.log(req.url)
	axios.get("http://127.0.0.1"+req.url).then(value=>{
		res.json(value.data);
	})
});


app.listen(8090,()=>{
	console.log("success");
})